
import { MIRCO_APPS_Data } from "@/micrpApp";

const SubApplicationComponent = () => import('@/layouts/subApplication.vue')

// 路由文件
export const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '登录'
    }
  },
  {
    path: '/',
    name: 'layout',
    component: () => import('@/layouts/index.vue'),
    redirect: '/home',
    children: [
      // 添加首页路由
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页',
          icon: 'House',
        }
      },
      ...MIRCO_APPS_Data.map(item => ({
        path: `/${item.baseRoute}/:chapters*`,
        name: item.name,
        meta: {
          baseRoute: item.baseRoute,
          url: item.path
        },
        component: SubApplicationComponent
      }))
    ]
  }
];
